<template>
  <div class="main">
    <div class="banner">
      <img src="../assets/images/gsjj-banner.png" alt="" />
    </div>
    <div class="center">
      <router-link class="item" :to="{name:'corporateBusinessDetail',query:{id:item.id}}" v-for="(item, index) in serviceData" :key="index">
        <div class="lf">
          <img :src="item.image" alt="" />
        </div>
        <div class="rt">
          <div class="title">
            {{ item.title }}
            <span>COMMERCIAL OPERATION</span>
          </div>
          <div class="cont" v-html="item.content"></div>
        </div>
      </router-link>
    </div>
  </div>
</template>

<script>
export default {
  data () {
    return {
      serviceData: []
    }
  },
  created () {
    // 公司业务
    this.$http.getService().then((res) => {
      if (res.data.code === 0) {
        this.serviceData = res.data.data
      } else {
        this.$message.error('请求失败，请重试！')
      }
    })
  }
}
</script>

<style lang="scss" scoped>
.banner {
  max-width: 1920px;
  height: 700px;
  position: relative;
  img {
    height: 100%;
    width: 100%;
  }
}
.center {
  max-width: 1200px;
  margin: 0 auto;
  font-family: PingFang SC;
  padding: 75px 0;
  .item {
    display: inline-block;
    width: 100%;
    overflow: hidden;
    .lf {
      width: 533px;
      height: 443px;
      img {
        width: 100%;
        height: 100%;
      }
    }
    .rt {
      width: 570px;
      .title {
        font-size: 32px;
        font-weight: bold;
        color: #333333;
        display: flex;
        align-items: flex-end;
        span {
          font-size: 20px;
          font-weight: bold;
          color: #666666;
        }
      }
      .cont {
        font-size: 20px;
        font-weight: 400;
        line-height: 30px;
        color: #999999;
        margin-top: 40px;
        // height: 360px;
        display: -webkit-box;
        -webkit-box-orient: vertical;
        -webkit-line-clamp: 12;
        overflow: hidden;
      }
    }
  }
  .item:nth-child(2n-1) {
    .lf {
      float: left;
    }
    .rt {
      float: right;
    }
  }
  .item:nth-child(2n) {
    .lf {
      float: right;
    }
    .rt {
      float: left;
    }
  }
  .item:not(:last-child) {
    margin-bottom: 157px;
  }
}
</style>
